<template>
  <view class="content">
    <view class="form">
      <view class="item">
        <view class="label">
          <view class="starImg"></view>
          姓名/账号
        </view>
        <view class="ipt">
          {{info.teacher_nickname}}
        </view>
      </view>
      <view class="item">
        <view class="label">
          <view class="starImg"></view>
          手机号码
        </view>
        <view class="ipt">
          {{info.teacher_phone}}
        </view>
      </view>
      <view class="item">
        <view class="label">
          <view class="starImg"></view>
          就职店铺
        </view>
        <view class="ipt" @tap="schoolShow = true">
          {{schoolText}}
        </view>
      </view>

    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        schoolText: "",
        sexText: "",
        fromText: "",
        info: {

        }
      };
    },
    onLoad(option) {
      this.info.teacher_id = option.teacher_id
      this.getData(option.teacher_id)
      this.getAllSchool();
    },
    methods: {
      async getData(teacher_id) {
        const {
          data: res
        } = await uni.$http.post('school/teacher/getTeacherDetail', {
          teacher_id: teacher_id
        })
        if (res.code != 1) {
          return this.toast.msg(res.msg)
        }
        this.info = res.data;
      },
      async getAllSchool() {
        const {
          data: res
        } = await uni.$http.post('school/index/getAllSchool')
        if (res.code != 1) {
          return this.toast.msg(res.msg)
        }
        res.data.forEach(i => {
          if (this.info.school_id == i.id) {
            this.schoolText = i.school_name
          }
        })
      }
    }
  }
</script>

<style lang="scss">
  .content {
    min-height: 100vh;

    .form {
      width: 652rpx;
      margin: 40rpx auto;

      .item {
        display: flex;
        align-items: center;
        padding: 0 35rpx 0 19rpx;
        margin-bottom: 30rpx;
        width: 652rpx;
        height: 78rpx;
        line-height: 78rpx;
        border-radius: 10rpx;
        border: 2rpx solid #FCF7F7;

        .label {
          display: flex;
          align-items: center;
          font-size: 28rpx;
          margin-right: 70rpx;
          width: 160rpx;

          .starImg {
            width: 14rpx;
            height: 42rpx;
            margin-right: 15rpx;
          }
        }

        .ipt {
          flex: 1;
          position: relative;
          display: flex;
          align-items: center;
          color: #666;

          .lowerImg {
            position: absolute;
            right: 0;
            width: 20rpx;
            height: 11rpx;
          }
        }

        .time {
          color: #666;
          display: flex;
          align-items: center;

          .timeImg {
            width: 35rpx;
            height: 35rpx;
            margin-right: 17rpx;

          }
        }
      }

      .textBox {
        padding: 0 35rpx 0 19rpx;
        display: flex;
        border: 2rpx solid #FCF7F7;

        .label {
          height: 70rpx;
          display: flex;
          align-items: center;
          font-size: 28rpx;
          margin-right: 70rpx;
          width: 160rpx;

          .starImg {
            width: 14rpx;
            height: 42rpx;
            margin-right: 15rpx;
          }
        }

        .ipt {
          flex: 1;
          height: 352rpx;

          .u-textarea {
            height: 352rpx;
            border: none;
            padding-left: 0;

            /deep/.u-textarea__field {
              height: 352rpx !important;
            }

            .uni-textarea-textarea {
              height: 352rpx;
            }
          }
        }
      }
    }

    .btn {
      position: fixed;
      bottom: 50rpx;
      left: 50%;
      transform: translateX(-50%);
      width: 652rpx;
      height: 78rpx;
      line-height: 78rpx;
      text-align: center;
      background: #CCCCCC;
      border: 2rpx solid #69A1E0;
    }
  }
</style>